{include file="public:header"/}
<!--添加楼盘-->
<form id="info_form" action="{:url('addDo')}" method="post" enctype="multipart/form-data">
<div class="pad_lr_10">
	<div class="col_tab">
		<ul class="J_tabs tab_but cu_li">
            <li class="current">基本信息</li>
            <li>基础数据</li>
            <li>详细内容</li>
            <li>SEO设置</li>
		</ul>
		<div class="J_panes">
			<div class="content_list pad_10">
				<table width="100%" cellspacing="0" class="table_form">
                    <tr>
                        <th width="120">所属区域 :</th>
                        <td>
                            <select class="J_cate_select mr10" data-pid="0" data-menuid="1" data-uri="{:url('City/ajaxGetchilds')}" data-selected=""></select>
                            <input type="hidden" name="area" id="J_cate_id" value="" />
                        </td>
                    </tr>
		            <tr>
						<th>楼盘名称 :</th>
						<td>
							<input type="text" name="title" id="J_title" class="input-text" size="40">
					       </td>
					</tr>

                    <tr>
                        <th>楼盘均价 :</th>
                        <td>
                            <input type="text" name="average_price"  class="input-text" size="10" /> <span>元/平米</span>
                            开盘价 :
                            <input type="text" name="price"  class="input-text" size="10" /> <span>元/平米</span>
                            最低首付 :
                            <input type="text" name="shoufu" id="shoufu" class="input-text" size="10" /> <span>万元</span>
                        </td>
                    </tr>
                    {if condition='$site.hongbao eq 1'}
                    <tr>
                        <th>红包金额 :</th>
                        <td>
                            <input type="text" class="input-text" name="money" value="0" size="20">元
                        </td>
                    </tr>
                    {/if}
                    <tr>
                        <th>楼盘状态 :</th>
                        <td>{:getLinkMenu(1,'house_status','radio')}</td>
                    </tr>
                    <tr id="open_time">
                        <th>开盘时间 :</th>
                        <td>
                            <input type="text" name="open_time" id="J_open_time" value="" class="input-text" size="12" /><span class="date"></span>
                            交房时间 :
                            <input type="text" name="complate_time" id="J_complate_time" value="" class="input-text" size="12" />
                        </td>
                    </tr>
                    <tr>
                        <th>地图标注：</th>
                        <td>
                            <input type="text" name="map" id="map" class="input-text" size="27" value=""/>
                            &nbsp;&nbsp;<a href="http://api.map.baidu.com/lbsapi/getpoint/" style="padding: 8px;color:#ffffff;background: #008000" target="_blank">获取百度地图坐标</a>
                        </td>
                    </tr>
                    <tr>
                        <th>特色标签 :</th>
                        <td>
                            {:getLinkMenu(5,'tags_id','checkbox')}
                        </td>
                    </tr>
                    <tr>
                        <th>户型类型 :</th>
                        <td>{:getLinkMenu(6,'room_type','checkbox')}</td>
                    </tr>
                    <tr>
                        <th>楼盘类型 :</th>
                        <td>{:getLinkMenu(7,'house_type','checkbox')}</td>
                    </tr>
                    <tr>
                        <th>楼层类型 :</th>
                        <td>{:getLinkMenu(8,'floor_type','checkbox')}<br><span>1~3层为低层,4~7层为多层,8~12层为小高层,13~25层为高层26层,100米以上为超高层</span></td>
                    </tr>
                    <tr>
                        <th>装修程度 :</th>
                        <td>{:getLinkMenu(9,'zhuangxiu_id','radio')}</td>
                    </tr>
                    <tr>
                        <th>楼盘地址 :</th>
                        <td><input type="text" name="address" id="address" class="input-text" size="40"/> </td>
                    </tr>
                    <tr>
                        <th>售楼处地址 :</th>
                        <td><input type="text" name="sale_address" id="sale_address" class="input-text" size="40"/> </td>
                    </tr>
                    <tr>
                        <th>售楼处电话 :</th>
                        <td><input type="text" name="sale_phone[phone]" id="sale_phone" class="input-text" size="25"/> 转 <input type="text" name="sale_phone[fenhao]" id="fenhao" class="input-text" size="10"/></td>
                    </tr>
                    <tr>
                        <th>预售证 :</th>
                        <td>
                            <input type="text" name="yushou" class="input-text" size="40">
                        </td>
                    </tr>
		            <tr>
						<th>缩略图:</th>
						<td><input type="file" name="img" id="img" class="input-text"  style="width:200px;" /> 图片尺寸：310*200</td>
		 			</tr>

                    <tr>
                        <th>是否团购 :</th>
                        <td><input type="checkbox" name="is_group" value="1"></td>
                    </tr>
                    <tr id="group" style="display:none;">
                        <th>团购优惠 :</th>
                        <td>
                            <textarea name="group_youhui" id="group_youhui" style="width:600px;height:50px;resize:none;"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <th>惠 :</th>
                        <td><input type="text" name="youhui" class="input-text"  size="40"></td>
                    </tr>
                    <tr>
                        <th>独家优惠 :</th>
                        <td><textarea name="special_youhui" style="width:600px;height:50px;resize: none;"></textarea></td>
                    </tr>

                    <tr>
                        <th>人气 :</th>
                        <td>
                            <input type="text" name="hits" class="input-text" value="1" size="10" />&nbsp;&nbsp;
                            关注 : <input type="text" name="collection"  class="input-text" value="0" size="10" />&nbsp;&nbsp;
                        </td>
                    </tr>

                    <tr>
                        <th>推荐位 :</th>
                        <td>
                            {volist name="pos_list" id="vo"}
                            <label><input type="checkbox" name="position[]" value="{$vo.id}">{$vo.title}</label>
                            {/volist}
                        </td>
                    </tr>
					<tr>
						<th>状态 :</th>
		 				<td>
		                	<label><input type="radio" name="status" class="radio_style" value="1" checked="checked"> 启用 </label>&nbsp;&nbsp;
							<label><input type="radio" name="status" class="radio_style" value="0" >禁用</label>
						</td>
					</tr>

				</table>
			</div>
            <div class="content_list pad_10 hidden">
                <table width="100%" cellspacing="0" class="table_form">
                    <tr>
                        <th>楼盘概况 :</th>
                        <td>
                            <table width="88%"  cellspacing="0" class="table_form">
                                <tr>
                                    <th width="100">建筑面积：</th>
                                    <td><input type="text" name="data[attr][jzmj]" class="input-text" size="20" /></td>
                                    <th width="100">物业类型：</th>
                                    <td><input type="text" name="data[attr][wylx]" class="input-text" size="20" /></td>
                                    <th width="100">规划面积：</th>
                                    <td><input type="text" name="data[attr][hxmj]" class="input-text" size="20" /></td>
                                </tr>
                                <tr>
                                    <th width="100">建筑类别：</th>
                                    <td><input type="text" name="data[attr][jzlb]" class="input-text" size="20" /></td>
                                    <th width="100">装修情况：</th>
                                    <td><input type="text" name="data[attr][zxqk]" class="input-text"  size="20" /></td>
                                    <th width="100">产　　权：</th>
                                    <td><input type="text" name="data[attr][chanquan]" class="input-text"  size="20" /></td>
                                </tr>
                                <tr>
                                    <th width="100">户　　数：</th>
                                    <td><input type="text" name="data[attr][hushu]" class="input-text" size="20" /></td>
                                    <th width="100">容 积 率：</th>
                                    <td><input type="text" name="data[attr][rjl]" class="input-text" size="20" /></td>
                                    <th width="100">开 发 商：</th>
                                    <td><input type="text" name="data[attr][kfs]" class="input-text" size="20" /></td>
                                </tr>
                                <tr>
                                    <th width="100">绿 化 率：</th>
                                    <td><input type="text" name="data[attr][lhl]" class="input-text"  size="20" /></td>
                                    <th width="100">物业公司：</th>
                                    <td><input type="text" name="data[attr][wygs]" class="input-text" size="20" /></td>
                                    <th width="100">车    位：</th>
                                    <td><input type="text" name="data[attr][chewei]" class="input-text" size="20" /></td>
                                </tr>
                                <tr>
                                    <th width="100">物 业 费：</th>
                                    <td><input type="text" name="data[attr][wuyefee]" class="input-text"  size="20" /></td>
                                    <th width="100">楼盘朝向：</th>
                                    <td><input type="text" name="data[attr][loupanzhaoxiang]" class="input-text" size="20" /></td>
                                    <th width="100">建筑设计单位：</th>
                                    <td><input type="text" name="data[attr][shejidanwei]" class="input-text" size="20" /></td>
                                </tr>
                                <tr>
                                    <th width="100">道路交通：</th>
                                    <td colspan="5"><textarea name="data[attr][daolujiaotong]" style="width: 780px;height: 66px;"></textarea></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <th>配套信息 :</th>
                        <td>
                            <table width="88%"  cellspacing="0" class="table_form">
                                <tr>
                                    <th style="width: 100px;">学校：</th>
                                    <td><textarea name="data[peitao][xuexiao]" style="width: 780px;height: 66px;"></textarea></td>
                                </tr>
                                <tr>
                                    <th>购物：</th>
                                    <td><textarea name="data[peitao][gouwu]" style="width: 780px;height: 66px;"></textarea></td>
                                </tr>
                                <tr>
                                    <th>医院：</th>
                                    <td><textarea name="data[peitao][yiyuan]" style="width: 780px;height: 66px;"></textarea></td>
                                </tr>
                                <tr>
                                    <th>生活：</th>
                                    <td><textarea name="data[peitao][shenghuo]" style="width: 780px;height: 66px;"></textarea></td>
                                </tr>
                                <tr>
                                    <th>娱乐：</th>
                                    <td><textarea name="data[peitao][yule]" style="width: 780px;height: 66px;"></textarea></td>
                                </tr>
                                <tr>
                                    <th>餐饮：</th>
                                    <td><textarea name="data[peitao][canyin]" style="width: 780px;height: 66px;"></textarea></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="content_list pad_10 hidden">
                <table width="100%" cellspacing="0" class="table_form">
                    <tr>
                        <th>楼盘优点 :</th>
                        <td><textarea name="data[youdian]" id="youdian" style="width:780px;height:100px;resize: none;"></textarea></td>
                    </tr>
                    <tr>
                        <th>楼盘缺点 :</th>
                        <td><textarea name="data[quedian]" id="quedian" style="width:780px;height:100px;resize: none;"></textarea></td>
                    </tr>
                    <tr>
                        <th>项目介绍 :</th>
                        <td><script id="info" name="data[info]" type="text/plain"></script></td>
                    </tr>
                </table>
            </div>
			<div class="content_list pad_10 hidden">
				<table width="100%" cellspacing="0" class="table_form">
					<tr>
						<th width="120">seo标题 :</th>
		 				<td><input type="text" name="data[seo_title]" id="seo_title" class="input-text" size="60"></td>
					</tr>
					<tr>
						<th>seo关键词 :</th>
						<td><input type="text" name="data[seo_keys]" id="seo_keys" class="input-text" size="60"></td>
					</tr>
					<tr>
						<th>seo描述 :</th>
						<td><textarea name="data[seo_desc]" id="seo_desc" cols="80" rows="8"></textarea></td>
					</tr>
				</table>
			</div>
        </div>
		<div class="mt10"><input type="submit" value="提交" id="dosubmit" name="dosubmit" class="btn btn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>
	</div>
</div>
</form>
{include file="public:footer" /}
<script src="__PUBLIC__/js/plugins/jquery.tools.min.js"></script>
<script src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script src="__PUBLIC__/js/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
    window.UEDITOR_HOME_URL='__PUBLIC__/js/ueditor/';
    window.onload=function(){
        window.UEDITOR_CONFIG.initialFrameWidth=880;
        window.UEDITOR_CONFIG.initialFrameHeight=500;
        UE.getEditor('info',{autoFloatEnabled:false});

    }
</script>
<script type="text/javascript">
    var check_name_url = "{:url('House/ajaxCheckTitle')}";
    $(function(){
        $('ul.J_tabs').tabs('div.J_panes > div');
        $('.J_cate_select').cate_select({type:'str'});
        $.formValidator.initConfig({formid:"info_form",autotip:true});
        $("#J_title").formValidator({onshow:"请填写楼盘名称",onfocus:"请填写楼盘名称"}).inputValidator({min:1,onerror:"请填写楼盘名称"}).ajaxValidator({
            type : "get",
            url : check_name_url,
            datatype : "json",
            async:'false',
            success : function(result){
                if(result.status == 0){
                    return false;
                }else{
                    return true;
                }
            },
            buttons: $("#dosubmit"),
            onerror : "该楼盘已经存在",
            onwait : "正在验证"
        });
        $("#J_price").formValidator({onshow:"楼盘价格只能填写数字(元/平米)",onfocus:"请填写楼盘价格"}).inputValidator({min:1,onerror:"请填写楼盘价格"}).regexValidator({regexp:"num1",datatype:"enum",onerror:"价格只能为数字"});
       // $("#J_shoufu").formValidator({onshow:"最低首付只能填写数字",onfocus:"请填写最低首付"}).inputValidator({min:1,onerror:"请填写最低首付"}).regexValidator({regexp:"num1",datatype:"enum",onerror:"价格只能为数字"});
        $("#J_cate_id").formValidator({onshow:"请选择区域",onfocus:"请选择区域"}).inputValidator({min:1,onerror:"请选择区域"});
        $(":radio[name='house_status']").formValidator({onshow:"请选择楼盘状态",onfocus:"请选择楼盘状态"}).inputValidator({min:1,max:1,onerror:"请选择楼盘状态"});
        $(":checkbox[name^='tags_id']").formValidator({onshow:"请选择特色标签",onfocus:"你至少选择1项"}).inputValidator({min:1,max:10,onerror:"请至少选择一项"});
        $(":checkbox[name^='room_type']").formValidator({onshow:"请选户型类型",onfocus:"你至少选择1项"}).inputValidator({min:1,max:10,onerror:"请至少选择一项"});
        $(":checkbox[name^='house_type']").formValidator({onshow:"请选择楼盘类型",onfocus:"你至少选择1项"}).inputValidator({min:1,max:10,onerror:"请至少选择一项"});
        $(":checkbox[name^='floor_type']").formValidator({onshow:"请选楼层类型",onfocus:"你至少选择1项"}).inputValidator({min:1,max:10,onerror:"请至少选择一项"});
        $(":radio[name='zhuangxiu_id']").formValidator({onshow:"请选择装修程度",onfocus:"请选择装修程度"}).inputValidator({min:1,max:1,onerror:"请选择装修程度"});

    });
  $(function(){
      $("input[name='is_group']").bind('click',function(){
          if($(this).attr('checked')){
              $("#group").show();
          }else{
              $("#group").hide().find('textarea').val('');

          }
      });
     $(":radio[name='house_status']").click(function(){
        var val = $(this).val();
         if(val == 40){
             $("#open_time").hide();
         }else{
             $("#open_time").show();
         }
     });

  });
   </script>
</body>
</html>